/**
 * Created by Administrator on 2017/3/2 0002.
 */
var Page1={
    create:function () {
    var page={};
        page.ui=new PIXI.DisplayObjectContainer();

        var graphic_bg=new PIXI.Graphics();
        graphic_bg.beginFill(0x0);
        graphic_bg.drawRect(0,0,740,1136);
        page.ui.addChild(graphic_bg);

        var p1=Easy.CreateSprite('assets/images/p1_0.png',0,0,0,0,1);
        page.ui.addChild(p1);
        var p2=Easy.CreateSprite('assets/images/p1_1.png',0,0,0,0,1);
        page.ui.addChild(p2);
        TweenMax.to(p1,2,{y:-10,yoyo:true,repeat:-1,ease:Cubic.easeInOut});
        // TweenMax.to(p2,4,{y:-10,yoyo:true,repeat:-1,ease:Cubic.easeInOut});
        var p3=Easy.CreateSprite('assets/images/p1_2.png',381,540,0.5,0.5,1);
        page.ui.addChild(p3);

        var click=Easy.CreateSprite('assets/images/click.png',364,616,0.5,0.5,1);
        page.ui.addChild(click);
        TweenMax.to(click.scale,0.7,{x:0.8,y:0.8,yoyo:true,repeat:-1,ease:Cubic.easeInOut});

        // var bg=new PIXI.Sprite.fromImage('assets/images/2@2x.png');

        // var mc=Easy.CreateMC(61,'assets/images/01/P1.','.jpg',0,0,740,1136,0.0,0.0);
        // mc.gotoAndPlay(1);
        // page.ui.addChild(mc);
        // var points=[];
        // for (var i = 0; i < 20; i++) {
        //     points.push(new PIXI.Point(i * 50, 0));
        // };
        // var plane = new PIXI.mesh.Plane(resource["assets/images/2.png"].texture,100,100);
        // plane.skew.y=0.1;
        //
        // page.ui.addChild(plane);
        
        page.In=function () {
            console.log('in');
            p1.alpha=p2.alpha=p3.alpha=0;
            click.alpha=0;
            TweenMax.to(p1,1,{alpha:1});
            TweenMax.to(p2,1,{delay:0.5,alpha:1});
            TweenMax.to(p3,1,{delay:1,alpha:1});
            TweenMax.to(click,1,{delay:1.5,alpha:0.8});
        }
        page.Out=function () {
            console.log('out');
        }

       
    return page;
    }
}